SWEP.Category 		= "HL2 Beta Sweps"
SWEP.PrintName		= "HMG1"	
SWEP.Author		= "Valve"

SWEP.ViewModelFOV	= 55
SWEP.ViewModelFlip	= false
SWEP.ViewModel		= "models/weapons/v_hmg.mdl"
SWEP.WorldModel		= "models/weapons/w_hmg1.mdl"
SWEP.AnimPrefix		= "ar2"
SWEP.HoldType		= "ar2"

SWEP.Spawnable			= true
SWEP.AdminSpawnable		= true

SWEP.Primary.ClipSize		= 60			// Size of a clip
SWEP.Primary.DefaultClip	= 100			// Default number of bullets in a clip
SWEP.Primary.Automatic		= true			// Automatic/Semi Auto
SWEP.Primary.Delay		= 0.3
SWEP.Primary.Ammo		= "SMG1"

SWEP.Secondary.ClipSize		= -1			// Size of a clip
SWEP.Secondary.DefaultClip	= -1			// Default number of bullets in a clip
SWEP.Secondary.Automatic	= false			// Automatic/Semi Auto
SWEP.Secondary.Ammo		= "none"

ScopeLevel = 0

/*---------------------------------------------------------
	Initialize
---------------------------------------------------------*/
function SWEP:Initialize()

end

/*---------------------------------------------------------
	Holster
---------------------------------------------------------*/
function SWEP:Holster()

	return true
end



/*---------------------------------------------------------
	Reload
---------------------------------------------------------*/
function SWEP:Reload()
	if self:DefaultReload( ACT_VM_RELOAD ) then 
		self:EmitSound(Sound("weapons/smg2/smg2_reload.wav")) 
	end
end


/*---------------------------------------------------------
   Think
---------------------------------------------------------*/
function SWEP:Think()
end


/*---------------------------------------------------------
	PrimaryAttack
---------------------------------------------------------*/
function SWEP:PrimaryAttack()

	// Make sure we can shoot first
	if ( !self:CanPrimaryAttack() ) then return end

	//Set Delay and Fire
	if self.ScopeLevel == 0 or == 1 or == 2 then
		// Shoot 1 bullet, 10 damage, 0.07 aimcone
		self:ShootBullet( 7, 1, 0.055 )
		// Delay Attack
		self.Weapon:SetNextPrimaryFire( CurTime() + 0.08 )
		// Play shoot sound
		self:EmitSound( Sound("weapons/hmg1_2.wav") )
		// Remove 1 bullet from our clip
		self:TakePrimaryAmmo( 1 )
       end
	
end

/*---------------------------------------------------------
	SecondaryAttack
---------------------------------------------------------*/
function SWEP:SecondaryAttack()

	if self.ScopeLevel == 0 then

        	if(SERVER) then
            		self.Owner:SetFOV( 45, 0 )
                end

        	self.ScopeLevel == 1

	elseif self.ScopeLevel == 1 then

		if(SERVER) then
			self.Owner:SetFOV( 25, 0 )
                end

		self.ScopeLevel == 2

	elseif self.ScopeLevel == 2 then

        	if(SERVER) then
			self.Owner:SetFOV( 0, 0 )
                end

        	self.ScopeLevel == 0
                 
        end

end